//
// CTextureFile.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CTextureFile extends ITexture {
  private long swigCPtr;

  public CTextureFile(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CTextureFile_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTextureFile obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTextureFile(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CTextureFile() {
    this(nel3dJNI.new_CTextureFile__SWIG_0(), true);
  }

  public CTextureFile(CTextureFile other) {
    this(nel3dJNI.new_CTextureFile__SWIG_1(CTextureFile.getCPtr(other), other), true);
  }

  public CTextureFile assign(CTextureFile other) {
    return new CTextureFile(nel3dJNI.CTextureFile_assign(swigCPtr, this, CTextureFile.getCPtr(other), other), false);
  }

  public CTextureFile(String s) {
    this(nel3dJNI.new_CTextureFile__SWIG_2(s), true);
  }

  public void setFileName(String s) {
    nel3dJNI.CTextureFile_setFileName(swigCPtr, this, s);
  }

  public String getFileName() {
    return nel3dJNI.CTextureFile_getFileName(swigCPtr, this);
  }

  public boolean allowDegradation() {
    return nel3dJNI.CTextureFile_allowDegradation(swigCPtr, this);
  }

  public void setAllowDegradation(boolean allow) {
    nel3dJNI.CTextureFile_setAllowDegradation(swigCPtr, this, allow);
  }

  public boolean supportSharing() {
    return nel3dJNI.CTextureFile_supportSharing(swigCPtr, this);
  }

  public String getShareName() {
    return nel3dJNI.CTextureFile_getShareName(swigCPtr, this);
  }

  public void enableSharing(boolean enable) {
    nel3dJNI.CTextureFile_enableSharing(swigCPtr, this, enable);
  }

  public void doGenerate(boolean async) {
    nel3dJNI.CTextureFile_doGenerate__SWIG_0(swigCPtr, this, async);
  }

  public void doGenerate() {
    nel3dJNI.CTextureFile_doGenerate__SWIG_1(swigCPtr, this);
  }

  public void serial(IStream f) {
    nel3dJNI.CTextureFile_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public static void buildBitmapFromFile(SWIGTYPE_p_NLMISC__CBitmap dest, String fileName, boolean asyncload, short mipMapSkip, boolean enlargeCanvasNonPOW2Tex) {
    nel3dJNI.CTextureFile_buildBitmapFromFile__SWIG_0(SWIGTYPE_p_NLMISC__CBitmap.getCPtr(dest), fileName, asyncload, mipMapSkip, enlargeCanvasNonPOW2Tex);
  }

  public static void buildBitmapFromFile(SWIGTYPE_p_NLMISC__CBitmap dest, String fileName, boolean asyncload, short mipMapSkip) {
    nel3dJNI.CTextureFile_buildBitmapFromFile__SWIG_1(SWIGTYPE_p_NLMISC__CBitmap.getCPtr(dest), fileName, asyncload, mipMapSkip);
  }

  public static void buildBitmapFromFile(SWIGTYPE_p_NLMISC__CBitmap dest, String fileName, boolean asyncload) {
    nel3dJNI.CTextureFile_buildBitmapFromFile__SWIG_2(SWIGTYPE_p_NLMISC__CBitmap.getCPtr(dest), fileName, asyncload);
  }

  public void setMipMapSkipAtLoad(short level) {
    nel3dJNI.CTextureFile_setMipMapSkipAtLoad(swigCPtr, this, level);
  }

  public short getMipMapSkipAtLoad() {
    return nel3dJNI.CTextureFile_getMipMapSkipAtLoad(swigCPtr, this);
  }

  public void setEnlargeCanvasNonPOW2Tex(boolean enlarge) {
    nel3dJNI.CTextureFile_setEnlargeCanvasNonPOW2Tex(swigCPtr, this, enlarge);
  }

  public boolean getEnlargeCanvasNonPOW2Tex() {
    return nel3dJNI.CTextureFile_getEnlargeCanvasNonPOW2Tex(swigCPtr, this);
  }

  public static void setSupportNonPowerOfTwoTextures(boolean support) {
    nel3dJNI.CTextureFile_setSupportNonPowerOfTwoTextures(support);
  }

  public static boolean supportNonPowerOfTwoTextures() {
    return nel3dJNI.CTextureFile_supportNonPowerOfTwoTextures();
  }

}
